package com.jxc.EL;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/info")
public class StudentServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // 写一个Student类，实例化一个student对象
        Student stu = new Student();
        stu.setName("jxc");
        stu.setMobile("123456");
        // 将student对象作为自定义属性，请求转发给EL_info.jsp
        req.setAttribute("student",stu);
        req.getRequestDispatcher("/EL_info.jsp").forward(req,resp);
    }
}
